package db

import "errors"

type TupleClass struct {
	tupleDesc TupleDescClass
	field     []FieldClass
	lenth     int //字段长度
}

func NewTuple(tupleDesc TupleDescClass) *TupleClass {
	tuple := &TupleClass{}
	tuple.tupleDesc = tupleDesc
	tuple.lenth = tupleDesc.ItemNum
	return tuple
}

func (t TupleClass) SetField(i int, field FieldClass) error {
	if i < 0 || i >= t.lenth {
		return errors.New("非法的字段")
	}
	return nil
}
